package com.sgb.kjwl.model.api;

import com.sgb.kjwl.model.entity.AddShoppingCar;
import com.sgb.link.entity.AreaEntity;
import com.sgb.kjwl.model.entity.BannerEntity;
import com.sgb.kjwl.model.entity.BidDetailEntity;
import com.sgb.kjwl.model.entity.BidInvitationListEntity;
import com.sgb.kjwl.model.entity.BuildEntity;
import com.sgb.kjwl.model.entity.CompanyBuyEntity;
import com.sgb.kjwl.model.entity.CompanyBuyHeader;
import com.sgb.kjwl.model.entity.DeleteShoppingCar;
import com.sgb.kjwl.model.entity.DeviceAttrEntity;
import com.sgb.kjwl.model.entity.DeviceDetailEntity;
import com.sgb.kjwl.model.entity.DeviceEntity;
import com.sgb.kjwl.model.entity.DeviceOutEntity;
import com.sgb.jicai.entity.FilterEntity;
import com.sgb.kjwl.model.entity.InformationEntity;
import com.sgb.kjwl.model.entity.LeaseEntity;
import com.sgb.kjwl.model.entity.LoginEntity;
import com.sgb.kjwl.model.entity.MachineDetailEntity;
import com.sgb.kjwl.model.entity.MachineInEntity;
import com.sgb.kjwl.model.entity.MachineOutEntity;
import com.sgb.kjwl.model.entity.MachineRentInEntity;
import com.sgb.kjwl.model.entity.MaterialCompanyEntity;
import com.sgb.kjwl.model.entity.MaterialDetailEntity;
import com.sgb.kjwl.model.entity.MaterialListEntity;
import com.sgb.kjwl.model.entity.MaterialMenuEntity;
import com.swgk.core.view.entity.MenuEntity;
import com.sgb.kjwl.model.entity.NewsEntity;
import com.sgb.kjwl.model.entity.PackersBusinessScopeEntity;
import com.sgb.kjwl.model.entity.PackersEntity;
import com.sgb.kjwl.model.entity.PackersPersonDetailEntity;
import com.sgb.kjwl.model.entity.PackersPersonEntity;
import com.sgb.kjwl.model.entity.PackersSkillsEntity;
import com.sgb.kjwl.model.entity.PackersTeamEntity;
import com.sgb.kjwl.model.entity.ParentAreaEntity;
import com.sgb.kjwl.model.entity.PickDeviceEntity;
import com.sgb.kjwl.model.entity.PickDeviceEntity2;
import com.sgb.kjwl.model.entity.PickLabourEntity;
import com.sgb.kjwl.model.entity.PickPackersEntity;
import com.sgb.kjwl.model.entity.PickProInfoEntity;
import com.swgk.core.util.PickSelectEntity;
import com.sgb.kjwl.model.entity.PickTypeEntity;
import com.sgb.kjwl.model.entity.ProChildListEntity;
import com.sgb.kjwl.model.entity.ProListEntity;
import com.sgb.kjwl.model.entity.ProvinceEntity;
import com.sgb.link.entity.PublicTypeEntity;
import com.sgb.kjwl.model.entity.RecommendEntity;
import com.sgb.kjwl.model.entity.RentingEntity;
import com.sgb.kjwl.model.entity.STFilterEntity;
import com.sgb.kjwl.model.entity.ScaleEntity;
import com.sgb.kjwl.model.entity.SearchDeviceOutEntity;
import com.sgb.kjwl.model.entity.SearchMachineInEntity;
import com.sgb.kjwl.model.entity.SearchMachineOutEntity;
import com.sgb.kjwl.model.entity.SearchMailEntity;
import com.sgb.kjwl.model.entity.SearchMaterialEntity;
import com.sgb.kjwl.model.entity.SearchMaterialEntity3;
import com.sgb.kjwl.model.entity.ShopImEntity;
import com.sgb.kjwl.model.entity.ShoppingCarEntity;
import com.sgb.kjwl.model.entity.SupplierEntity;
import com.sgb.kjwl.model.entity.TalentEntity;
import com.sgb.kjwl.model.entity.TenderInfoEntity;
import com.sgb.kjwl.model.entity.UserMsgEntity;
import com.sgb.kjwl.model.entity.lease.CarListEntity3;
import com.sgb.kjwl.model.entity.lease.DeviceListEntity3;
import com.sgb.kjwl.model.entity.lease.MachineListEntity3;
import com.sgb.kjwl.model.entity.pick.TenderDetailEntity3;
import com.sgb.kjwl.model.entity.pick.TenderDictEntity3;
import com.sgb.kjwl.model.entity.pick.TenderInfoBasicEntity3;
import com.sgb.kjwl.model.entity.request.LeaseMachineFilterJson;
import com.sgb.kjwl.model.entity.request.MachineFilterJson3;
import com.sgb.kjwl.model.entity.request.MaterialFilterJson;
import com.sgb.kjwl.model.entity.request.MaterialFilterJson3;
import com.sgb.kjwl.model.entity.self.GoodsListEntity3;
import com.sgb.kjwl.model.entity.self.SelfPickListEntity3;
import com.sgb.kjwl.model.entity.supplier3.DictEntity3;
import com.sgb.kjwl.model.entity.supplier3.SupplierRecommendEntity;
import com.sgb.kjwl.model.entity.user.AddDeviceEntity;
import com.sgb.kjwl.model.entity.user.AddGoodsEntity;
import com.sgb.kjwl.model.entity.user.AddMachineInEntity;
import com.sgb.kjwl.model.entity.user.AddMachineOutEntity;
import com.sgb.kjwl.model.entity.user.AddPackersEntity;
import com.sgb.kjwl.model.entity.user.AddTalentEntity;
import com.sgb.kjwl.model.entity.user.AddressEntity;
import com.sgb.kjwl.model.entity.user.AuthEntity;
import com.sgb.kjwl.model.entity.user.CategoryEntity;
import com.sgb.kjwl.model.entity.user.DeviceStateEntity;
import com.sgb.kjwl.model.entity.user.DictEntity;
import com.sgb.kjwl.model.entity.user.GoodsEntity;
import com.sgb.kjwl.model.entity.user.MachineStateEntity;
import com.sgb.kjwl.model.entity.user.MachineryCompanyEntity;
import com.sgb.kjwl.model.entity.user.NewCategeryEntity;
import com.sgb.kjwl.model.entity.user.PackersStateEntity;
import com.sgb.kjwl.model.entity.user.PhotoEntity;
import com.sgb.kjwl.model.entity.user.SupplierAuthEntity;
import com.sgb.kjwl.model.entity.user.TalentTypeEntity;
import com.sgb.kjwl.model.entity.user.UnitEntity;
import com.sgb.kjwl.model.entity.user.UserAddressEntity;
import com.sgb.kjwl.model.response.CommonResponse;
import com.swgk.core.base.model.entity.ListResponse;
import com.swgk.core.base.api.BaseApiSourceImpl;
import com.swgk.core.base.model.entity.BaseEntity;
import com.swgk.core.util.SharedPreferenceUtil;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.Retrofit;

import static com.sgb.kjwl.api.UrlConfig.BASE_URL;


/**
 * Description:`
 * Author zhengkewen
 * Time 2019/4/2
 */
public class ApiSourceImpl extends BaseApiSourceImpl implements ApiSource {
    private static final String MACHINE_BASE_URL = "https://api.shigongbang.com:9099/";
    private static final String DEVICE_BASE_URL = "https://api.shigongbang.com:9494/";
    private static final String PACKERS_BASE_URL = "https://api.shigongbang.com:9999/";
    //服务器地址
    private static final String USER_CENTER_BASE_URL = BASE_URL;
    public static final String IMG_BASE_URL = BASE_URL;
    private RetrofitInterface retrofitInterface;
    private RetrofitInterface machineInterface;
    private RetrofitInterface deviceInterface;
    private RetrofitInterface packersInterface;
    private RetrofitInterface shoppingInterface;
    private RetrofitInterface materialInterface2;
    //用户中心
    private UserInterface userCenterInterface;
    //租赁模块
    private LeaseInterface leaseInterface;
    //招采模块
    private PickInterface pickInterface;
    //图片上传
    private UserInterface imagsAddInterface;
    //首页
    private HomeInterface homeInterface;
    //通用接口
    private CommonInterface commonInterface;
    //工程材料相关
    private MaterialInterface materialInterface;

    @Override
    public void setRetrofit(Retrofit retrofit) {
        retrofitInterface = retrofit.create(RetrofitInterface.class);
        shoppingInterface = retrofit.newBuilder().baseUrl(USER_CENTER_BASE_URL).build().create(RetrofitInterface.class);
        materialInterface2 = retrofit.newBuilder().baseUrl(USER_CENTER_BASE_URL).build().create(RetrofitInterface.class);
        pickInterface = retrofit.newBuilder().baseUrl(USER_CENTER_BASE_URL).build().create(PickInterface.class);
        imagsAddInterface = retrofit.newBuilder().baseUrl(IMG_BASE_URL).build().create(UserInterface.class);
        machineInterface = retrofit.newBuilder().baseUrl(MACHINE_BASE_URL).build().create(RetrofitInterface.class);
        deviceInterface = retrofit.newBuilder().baseUrl(DEVICE_BASE_URL).build().create(RetrofitInterface.class);
        packersInterface = retrofit.newBuilder().baseUrl(PACKERS_BASE_URL).build().create(RetrofitInterface.class);

        userCenterInterface = retrofit.newBuilder().baseUrl(USER_CENTER_BASE_URL).build().create(UserInterface.class);
        homeInterface = retrofit.newBuilder().baseUrl(USER_CENTER_BASE_URL).build().create(HomeInterface.class);
        commonInterface = retrofit.newBuilder().baseUrl(USER_CENTER_BASE_URL).build().create(CommonInterface.class);
        leaseInterface = retrofit.newBuilder().baseUrl(USER_CENTER_BASE_URL).build().create(LeaseInterface.class);
        materialInterface = retrofit.newBuilder().baseUrl(USER_CENTER_BASE_URL).build().create(MaterialInterface.class);
    }

    @Override
    public Observable<BaseEntity<List<BannerEntity>>> getMaterialBanner() {
        return retrofitInterface.getMaterialBanner();
    }

    @Override
    public Observable<BaseEntity<List<MenuEntity>>> getMenu() {
        return retrofitInterface.getMenu();
    }

    @Override
    public Observable<BaseEntity<List<MaterialMenuEntity>>> getMaterialMenu() {
        return retrofitInterface.getMaterialMenu();
    }

    @Override
    public Observable<ListResponse<List<MaterialListEntity>>> getMaterialList(String cid, String areacode) {
        Map<String, String> map = new HashMap();
        map.put("item_cid1", cid);
        map.put("areacode", areacode);
        map.put("item_provinceId", areacode);
        return retrofitInterface.getMaterialList(map);
    }

    @Override
    public Observable<ListResponse<List<SearchMaterialEntity>>> getMaterialFilterList(int page, int size, int sort, Map map) {
        return materialInterface2.getMaterialFilterList(page, size, sort, map);
    }

    @Override
    public Observable<BaseEntity<List<CommonResponse<SupplierEntity>>>> getSupplierList(String areacode) {
        return retrofitInterface.getSupplierList(areacode);
    }

    @Override
    public Observable<BaseEntity<List<CommonResponse<InformationEntity>>>> getInformation(String areacode) {
        return retrofitInterface.getInformation(areacode);
    }

    @Override
    public Observable<BaseEntity<NewsEntity>> getNewsDetail(String id) {
        return materialInterface2.getNewsDetail(id);
    }

    @Override
    public Observable<List<String>> getMaterialHotSearch() {
        return retrofitInterface.getMaterialHotSearch();
    }

    @Override
    public Observable<ListResponse<List<SearchMaterialEntity>>> getMaterialSearch(String areacode, String item_provinceId, String key, int page, int size) {
        return retrofitInterface.getMaterialSearch(areacode, item_provinceId, key, page, size);
    }

    @Override
    public Observable<BaseEntity<MaterialDetailEntity>> getMaterialDetail(String pid, String areacode) {
        return retrofitInterface.getMaterialDetail(pid, areacode);
    }

    @Override
    public Observable<BaseEntity<MaterialCompanyEntity>> getMaterialCompany(String cid, String areacode) {
        return retrofitInterface.getMaterialCompany(cid, areacode);
    }

    @Override
    public Observable<BaseEntity<List<BannerEntity>>> getMachineBanner() {
        return machineInterface.getMachineBanner();
    }

    @Override
    public Observable<BaseEntity<List<MenuEntity>>> getMachineMenu() {
        return machineInterface.getMachineMenu();
    }

    @Override
    public Observable<BaseEntity<List<LeaseEntity>>> getMachineLease(String areacode) {
        return machineInterface.getMachineLease(areacode);
    }

    @Override
    public Observable<BaseEntity<List<RentingEntity>>> getMachineRenting(String areacode) {
        return machineInterface.getMachineRenting(areacode);
    }

    @Override
    public Observable<BaseEntity<MachineRentInEntity>> getMachineInDetail(String id) {
        return machineInterface.getMachineInDetail(id);
    }

    @Override
    public Observable<BaseEntity<List<ParentAreaEntity<List<ParentAreaEntity>>>>> getMachineArea(int areacode) {
        return machineInterface.getMachineArea(areacode);
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<MachineOutEntity>>>> getMachineOut(int page, int size, int priceSort, Map map) {
        return machineInterface.getMachineOut(page, size, priceSort, map);
    }

    @Override
    public Observable<BaseEntity<List<PublicTypeEntity>>> getMachineType() {
        return machineInterface.getMachineType();
    }

    @Override
    public Observable<BaseEntity<List<FilterEntity<List<FilterEntity>>>>> getMachineFilter() {
        return machineInterface.getMachineFilter();
    }

    @Override
    public Observable<BaseEntity<List<FilterEntity<List<FilterEntity>>>>> getMachineFilterInfo(String categoryNo, String typeNo, int areacode) {
        return machineInterface.getMachineFilterInfo(categoryNo, typeNo, areacode);
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<MachineInEntity>>>> getMachineIn(int page, int limit, int priceSort, Map map) {
        return machineInterface.getMachineIn(page, limit, priceSort, map);
    }

    @Override
    public Observable<List<String>> getMachineHotSearch() {
        return machineInterface.getMachineHotSearch();
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<SearchMachineOutEntity>>>> getMachineSearch(int page, int size, String areacode, String key) {
        Map map = new HashMap();
        map.put("areacode", areacode);
        map.put("words", key);
        return machineInterface.getMachineSearch(page, size, map);
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<SearchMachineInEntity>>>> getMachineInSearch(int page, int size, String areacode, String key) {
        Map map = new HashMap();
        map.put("areacode", areacode);
        map.put("words", key);
        return machineInterface.getMachineInSearch(page, size, map);
    }

    @Override
    public Observable<BaseEntity<MachineDetailEntity>> getMachineDetail(String id) {
        return machineInterface.getMachineDetail(id);
    }

    @Override
    public Observable<BaseEntity<List<BannerEntity>>> getDeviceBanner() {
        return deviceInterface.getDeviceBanner();
    }

    @Override
    public Observable<BaseEntity<List<MenuEntity>>> getDeviceMenu() {
        return deviceInterface.getDeviceMenu();
    }

    @Override
    public Observable<BaseEntity<List<DeviceEntity>>> getDeviceRecommand(String areacode) {
        return deviceInterface.getDeviceRecommand(areacode);
    }

    @Override
    public Observable<ListResponse<List<DeviceOutEntity>>> getDeviceOut(Map map, int page, int limit, int priceSort) {
        map.put("page", page);
        map.put("limit", limit);
        map.put("priceSort", priceSort);
        return deviceInterface.getDeviceOut(map);
    }

    @Override
    public Observable<BaseEntity<List<ParentAreaEntity<List<ParentAreaEntity>>>>> getDeviceArea(int areaId) {
        return deviceInterface.getDeviceArea(areaId);
    }

    @Override
    public Observable<BaseEntity<List<ProvinceEntity<List<ProvinceEntity>>>>> getAllProvince() {
        return retrofitInterface.getAllProvince();
    }

    @Override
    public Observable<BaseEntity<List<FilterEntity<List<FilterEntity>>>>> getDeviceFilter() {
        return deviceInterface.getDeviceFilter();
    }

    @Override
    public Observable<BaseEntity<List<FilterEntity<List<FilterEntity>>>>> getDeviceFilterByNumber(String pNo, String cNo) {
        return deviceInterface.getDeviceFilterByNumber(pNo, cNo);
    }

    @Override
    public Observable<List<String>> getDeviceHotSearch() {
        return deviceInterface.getDeviceHotSearch();
    }

    @Override
    public Observable<ListResponse<List<SearchDeviceOutEntity>>> getDeviceOutSearch(int page, int size, String areacode, String key) {
        Map map = new HashMap();
        map.put("province_no", areacode);
        map.put("title", key);
        return deviceInterface.getDeviceOutSearch(page, size, 0, map);
    }

    @Override
    public Observable<DeviceDetailEntity> getDeviceDetail(String id) {
        return deviceInterface.getDeviceDetail(id);
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<DeviceAttrEntity>>>> getDeviceAttr(String id) {
        return deviceInterface.getDeviceAttribute(id);
    }

    @Override
    public Observable<BaseEntity<List<BannerEntity>>> getPackersBanner() {
        return packersInterface.getPackersBanner();
    }

    @Override
    public Observable<BaseEntity<List<MenuEntity>>> getPackersMenu() {
        return packersInterface.getPackersMenu();
    }

    @Override
    public Observable<BaseEntity<List<BuildEntity>>> getPackersBuild(String areacode) {
        return packersInterface.getPackersBuild(areacode);
    }

    @Override
    public Observable<BaseEntity<List<TalentEntity>>> getPackersTalent(String areacode) {
        return packersInterface.getPackersTalent(areacode);
    }

    @Override
    public Observable<BaseEntity<PackersEntity>> getPackersEntity(String id) {
        return packersInterface.getPackersEntity(id);
    }

    @Override
    public Observable<BaseEntity<PackersSkillsEntity>> getPackersSkillsEntity(String id) {
        return packersInterface.getPackersSkillsEntity(id);
    }

    @Override
    public Observable<BaseEntity<PackersBusinessScopeEntity>> getPackersBusinessScopeEntity(String id) {
        return packersInterface.getPackersBusinessScopeEntity(id);
    }

    @Override
    public Observable<BaseEntity<PackersPersonDetailEntity>> getPackersPersonDetailEntity(String id) {
        return packersInterface.getPackersPersonDetailEntity(id);
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<PackersPersonEntity>>>> getPackersPerson(int page, int limit, Map map) {
        return packersInterface.getPackersPerson(page, limit, map);
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<PackersTeamEntity>>>> getPackersTeam(int page, int limit, Map map) {
        return packersInterface.getPackersTeam(page, limit, map);
    }

    //购物车列表
    @Override
    public Observable<BaseEntity<List<ShoppingCarEntity>>> getShoppingCarEntity(String areacode) {
        return shoppingInterface.getShoppingCarEntity(areacode);
    }

    //加入购物车
    @Override
    public Observable<BaseEntity> addShoppingCar(AddShoppingCar addShoppingCar) {
        return shoppingInterface.addShoppingCar(addShoppingCar);
    }

    //获取购物车数量
    @Override
    public Observable<BaseEntity<String>> getCarCount(String areacode) {
        return shoppingInterface.getCarCount(areacode);
    }

    //token校验
    @Override
    public Observable<BaseEntity> checkToken(Map map) {
        return userCenterInterface.checkToken(map);
    }

    //更新购物车
    @Override
    public Observable<BaseEntity<Boolean>> updateShoppingCar(Map map) {
        return shoppingInterface.updateShoppingCar(map);
    }

    //删除购物车
    @Override
    public Observable<BaseEntity> deleteShoppingCar(DeleteShoppingCar deleteShoppingCar) {
        return shoppingInterface.deleteShoppingCar(deleteShoppingCar);
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<AreaEntity>>>> getAreaList() {
        //   return pickInterface.getAreaList();
        return null;
    }

    @Override
    public Observable<BaseEntity<List<ScaleEntity>>> getScaleList(String type) {
        //     return pickInterface.getScaleList(type);
        return null;
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<CompanyBuyHeader<CompanyBuyEntity>>>>> getCompanyBuy(Map map, int page, int size) {
        map.put("pageNum", page);
        map.put("pageSize", size);
        //      return pickInterface.getCompanyBuy(map);
        return null;
    }

    @Override
    public Observable<BaseEntity<List<PickTypeEntity>>> getTypeList() {
        //     return pickInterface.getTypeList();
        return null;
    }

    @Override
    public Observable<BaseEntity<PickProInfoEntity<ProListEntity<List<ProChildListEntity>>>>> companyProject(String compNo) {
        //      return pickInterface.companyProject(compNo);
        return null;
    }

    @Override
    public Observable<BaseEntity<TenderInfoEntity>> getHotTenderInfo(String no) {
        //    return pickInterface.getHotTenderInfo(no);
        return null;
    }

    @Override
    public Observable<BaseEntity<List<AddressEntity<List<AddressEntity>>>>> getCommonAddress() {
        return userCenterInterface.getCommonAddress();
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<PackersStateEntity>>>> getPublishPackers(String state, int page, int size) {
        return userCenterInterface.getPublishPackers(page, size, state, "");
    }

    @Override
    public Observable<BaseEntity> onPacker(String id) {
        Map map = new HashMap();
        map.put("id", id);
        return userCenterInterface.onPacker(map);
    }

    @Override
    public Observable<BaseEntity> offPacker(String id) {
        Map map = new HashMap();
        map.put("id", id);
        return userCenterInterface.offPacker(map);
    }

    @Override
    public Observable<BaseEntity> delPackersList(String id) {
        Map map = new HashMap();
        map.put("id", id);
        return userCenterInterface.delPackersList(map);
    }

    @Override
    public Observable<BaseEntity<List<CategoryEntity<CategoryEntity>>>> getPackersCategory() {
        return userCenterInterface.getPackersCategory();
    }

    @Override
    public Observable<BaseEntity> addPackers(AddPackersEntity entity) {
        return userCenterInterface.addPackers(entity);
    }

    @Override
    public Observable<BaseEntity> editPackers(AddPackersEntity entity) {
        return userCenterInterface.editPackers(entity);
    }

    @Override
    public Observable<BaseEntity<AddPackersEntity>> getPackersDetail(String id) {
        return userCenterInterface.getPackersDetail(id);
    }

    @Override
    public Observable<BaseEntity<List<AddressEntity<List<AddressEntity>>>>> getPackersAddress() {
        return userCenterInterface.getPackersAddress();
    }

    @Override
    public Observable<BaseEntity> addTalent(AddTalentEntity entity) {
        return userCenterInterface.addTalent(entity);
    }

    @Override
    public Observable<BaseEntity> editTalent(AddTalentEntity entity) {
        return userCenterInterface.editTalent(entity);
    }

    @Override
    public Observable<BaseEntity<AddTalentEntity>> getTalentDetail() {
        return userCenterInterface.getTalentDetail();
    }

    @Override
    public Observable<BaseEntity<List<TalentTypeEntity<List<TalentTypeEntity>>>>> getTalentType() {
        return userCenterInterface.getTalentType();
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<DeviceStateEntity>>>> getPublishDevice(String state, int page, int size, String text) {
        return userCenterInterface.getPublishDevice(page, size, state, text);
    }

    @Override
    public Observable<BaseEntity> addDevice(AddDeviceEntity entity) {
        return userCenterInterface.addDevice(entity);
    }

    @Override
    public Observable<BaseEntity> updateDevice(AddDeviceEntity entity) {
        return userCenterInterface.updateDevice(entity);
    }

    @Override
    public Observable<BaseEntity> addGoods(AddGoodsEntity entity) {
        return userCenterInterface.addGoods(entity);
    }

    @Override
    public Observable<BaseEntity> deviceOnlineOrOff(Map map) {
        return userCenterInterface.deviceOnlineOrOff(map);
    }

    @Override
    public Observable<BaseEntity> delDeviceList(Map map) {
        return userCenterInterface.delDeviceList(map);
    }

    @Override
    public Observable<BaseEntity<List<UnitEntity>>> getDeviceUnit() {
        return userCenterInterface.getDeviceUnit();
    }

    @Override
    public Observable<BaseEntity<List<PublicTypeEntity<List<PublicTypeEntity>>>>> getDeviceType(String no) {
        return userCenterInterface.getDeviceType(no);
    }

    @Override
    public Observable<BaseEntity<AddDeviceEntity>> getPublishDeviceDetail(String id) {
        return userCenterInterface.getPublishDeviceDetail(id);
    }

    @Override
    public Observable<BaseEntity<List<AddressEntity>>> getDeviceAddress(String parentNo) {
        return userCenterInterface.getDeviceAddress("1", parentNo);
    }

    @Override
    public Observable<BaseEntity<List<FilterEntity<List<FilterEntity>>>>> getPulishDeviceAttr(String firstCategory, String secCategory) {
        return userCenterInterface.getPulishDeviceAttr(firstCategory, secCategory);
    }


    @Override
    public Observable<BaseEntity> addMachineOut(AddMachineOutEntity entity) {
        return userCenterInterface.addMachineOut(entity);
    }

//    @Override
//    public Observable<BaseEntity> editMachineOut(AddMachineOutEntity entity) {
//        return userCenterInterface.editMachineOut(entity);
//    }

    @Override
    public Observable<BaseEntity<ListResponse<List<MachineStateEntity>>>> getPublishMachineOut(int page, int size, String status, String text) {
        return userCenterInterface.getPublishMachineOut(page, size, status, text);
    }

    @Override
    public Observable<BaseEntity<AddMachineOutEntity>> getPublishMachineOutDetail(String id, String categoryType) {
        return userCenterInterface.getPublishMachineOutDetail(id, categoryType);
    }

    @Override
    public Observable<BaseEntity> machineOutOnlineOrOff(String id, String status) {
        Map map = new HashMap();
        map.put("id", id);
        map.put("status", status);
        return userCenterInterface.machineOutOnlineOrOff(map);
    }

    @Override
    public Observable<BaseEntity> delMachineOutList(String id) {
        Map map = new HashMap();
        map.put("id", id);
        return userCenterInterface.delMachineOutList(map);
    }

    @Override
    public Observable<BaseEntity<AuthEntity<List<MachineryCompanyEntity>>>> getAuthInfo() {
        return userCenterInterface.getAuthInfo();
    }

    public Observable<BaseEntity<List<PublicTypeEntity<List<PublicTypeEntity>>>>> getMachineOutType() {
        return userCenterInterface.getMachineOutType();
    }

    @Override
    public Observable<BaseEntity<List<FilterEntity<List<FilterEntity>>>>> getMachineDict(String firstCategory, String secondCategory) {
        return userCenterInterface.getMachineDict(firstCategory, secondCategory);
    }

    @Override
    public Observable<BaseEntity<List<DictEntity>>> getMachinePrice() {
        return userCenterInterface.getMachinePrice();
    }

    @Override
    public Observable<BaseEntity> addMachineIn(AddMachineInEntity entity) {
        return userCenterInterface.addMachineIn(entity);
    }

    @Override
    public Observable<BaseEntity> editMachineIn(AddMachineInEntity entity) {
        return userCenterInterface.editMachineIn(entity);
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<MachineStateEntity>>>> getPublishMachineIn(int page, int size, String status) {
        return userCenterInterface.getPublishMachineIn(page, size, status);
    }

    @Override
    public Observable<BaseEntity> machineInOnlineOrOff(String id, String status) {
        return userCenterInterface.machineInOnlineOrOff(id, status);
    }

    @Override
    public Observable<BaseEntity> delMachineInList(String id) {
        return userCenterInterface.delMachineInList(id);
    }

    @Override
    public Observable<BaseEntity<AddMachineInEntity>> getPublishMachineInDetail(String id) {
        return userCenterInterface.getPublishMachineInDetail(id);
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<UserAddressEntity>>>> getUserAddressList() {
        return userCenterInterface.getUserAddressList();
    }

    @Override
    public Observable<BaseEntity> delAddress(String id) {
        return userCenterInterface.delAddress(id);
    }

    @Override
    public Observable<BaseEntity<UserAddressEntity>> searchAddress(String id) {
        return userCenterInterface.searchAddress(id);
    }

    @Override
    public Observable<BaseEntity> editAddress(UserAddressEntity data) {
        return userCenterInterface.editAddress(data);
    }

    @Override
    public Observable<BaseEntity> addAddress(UserAddressEntity data) {
        return userCenterInterface.addAddress(data);
    }

    @Override
    public Observable<BaseEntity<GoodsEntity>> getGoodsList(String status) {
        return userCenterInterface.getGoodsList(status);
    }

    @Override
    public Observable<BaseEntity> downGoods(String id) {
        return userCenterInterface.downGoods(id);
    }

    @Override
    public Observable<BaseEntity> upGoods(String id) {
        return userCenterInterface.upGoods(id);
    }

    @Override
    public Observable<BaseEntity> deleteGoods(String id) {
        return userCenterInterface.deleteGoods(id);
    }

    @Override
    public Observable<BaseEntity<List<BannerEntity>>> getHomeBanner() {
        return homeInterface.getHomeBanner();
    }

    @Override
    public Observable<BaseEntity<List<MenuEntity>>> getHomeMenu() {
        return homeInterface.getHomeMenu();
    }

    @Override
    public Observable<BaseEntity<List<MaterialMenuEntity>>> getHomeRecommendType(String areacode) {
        Map map = new HashMap();
        map.put("areacode", areacode);
        return homeInterface.getHomeRecommendType(map);
    }

    @Override
    public Observable<BaseEntity<List<RecommendEntity>>> getHomeRecommandList(String areacode, String type) {
//        Map map = new HashMap();
//        map.put("areacode", areacode);
//        map.put("code", type);
        return homeInterface.getHomeRecommandList(areacode, type, "10");
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<SupplierRecommendEntity>>>> getSupplierMapData(Map map) {
        return homeInterface.getSupplierMapData(map);
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<SupplierRecommendEntity>>>> getGoodsMapData(Map map) {
        return homeInterface.getGoodsData(map);
    }

    @Override
    public Observable<BaseEntity<List<DictEntity3>>> getSupplierCityData(String areacode) {
        return homeInterface.getSupplierCityData(areacode);
    }

    @Override
    public Observable<BaseEntity<List<DictEntity3>>> getSupplierDistanceData() {
        return homeInterface.getSupplierDistanceData();
    }

    @Override
    public Observable<BaseEntity<List<DictEntity3>>> getDistance() {
        return homeInterface.getDistance();
    }

    @Override
    public Observable<BaseEntity<List<DictEntity3>>> getSupplierSortData() {
        return homeInterface.getSupplierSortData();
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<SupplierRecommendEntity>>>> getSupplierList(Map map) {
        return homeInterface.getSupplierList(map);
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<SupplierRecommendEntity>>>> getGoodsList(Map map) {
        return homeInterface.getGoodsList(map);
    }

    @Override
    public Observable<BaseEntity<List<MenuEntity<MenuEntity<MenuEntity>>>>> getCategoryData(String areaCode) {
        return homeInterface.getCategoryData(areaCode);
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<PickDeviceEntity>>>> getPickBid(String no, String projectNo, int size, int num) {
        //       return pickInterface.getPickBid(no, projectNo, size, num);
        return null;
    }

    @Override
    public Observable<BaseEntity> register(String account, String pwd, String code) {
        Map map = new HashMap();
        map.put("telPhone", account);
        map.put("code", code);
        map.put("password", pwd);
        return userCenterInterface.register(map);
    }

    @Override
    public Observable<BaseEntity> getRegisterCode(String phone) {
        return userCenterInterface.getRegisterCode(phone);
    }

    @Override
    public Observable<BaseEntity> getForgetCode(String phone) {
        return userCenterInterface.getForgetCode(phone);
    }

    @Override
    public Observable<BaseEntity> forgetPwd(String account, String pwd, String code) {
        Map map = new HashMap();
        map.put("tel", account);
        map.put("tagCode", code);
        map.put("pwd", pwd);
        return userCenterInterface.forgetPwd(map);
    }

    @Override
    public Observable<LoginEntity> login(String account, String pwd, String code) {
        return userCenterInterface.login(account, pwd, "password", "false", code);
    }

    @Override
    public Observable<BaseEntity> loginOut(String accesstoken) {
        return userCenterInterface.loginOut(accesstoken);
    }

    @Override
    public Observable<BaseEntity<List<MenuEntity<MenuEntity<MenuEntity>>>>> getCategoryMenu(String areaCode) {
        return materialInterface2.getCategoryMenu(areaCode);
    }

    @Override
    public Observable<BaseEntity<List<NewCategeryEntity<List<NewCategeryEntity<List<NewCategeryEntity>>>>>>> getNewCategoryMenu() {
        return materialInterface2.getNewCategoryMenu();
    }

    @Override
    public Observable<BaseEntity<SupplierAuthEntity>> getSupplierAuthInfo() {
        return userCenterInterface.getSupplierAuthInfo();
    }

    @Override
    public Observable<BaseEntity> addSupplierAuth(SupplierAuthEntity supplierAuthEntity) {
        return userCenterInterface.addSupplierAuth(supplierAuthEntity);
    }

    @Override
    public Observable<BaseEntity<PhotoEntity>> uploadPhoto(Map<String, RequestBody> photos) {
        return userCenterInterface.uploadPhoto(photos);
    }

    @Override
    public Observable<BaseEntity> uploadFile(Map<String, RequestBody> files) {
        return userCenterInterface.uploadFile(files);
    }

    @Override
    public Observable<BaseEntity<List<String>>> uploadMutiFile(Map<String, RequestBody> files) {
        return imagsAddInterface.uploadMutiFile(files);
    }

    @Override
    public Observable<List<String>> getCompanyType() {
        return userCenterInterface.getCompanyType();
    }

    @Override
    public Observable<BaseEntity<List<DictEntity>>> getBusiness() {
        return userCenterInterface.getBusiness();
    }

    @Override
    public Observable<BaseEntity<List<AddressEntity<List<AddressEntity<List<AddressEntity>>>>>>> getAddress() {
        return userCenterInterface.getAddress();
    }


    @Override
    public Observable<BaseEntity<UserMsgEntity>> getCurrentUserInfo() {
        return userCenterInterface.getCurrentUserInfo();
    }

    @Override
    public Observable<BaseEntity> changeMobile(Map map) {
        return userCenterInterface.changeMobile(map);
    }

    @Override
    public Observable<BaseEntity> changePwd(Map map) {
        return userCenterInterface.changePwd(map);
    }

    @Override
    public Observable<BaseEntity> commitBankInfo(Map map) {
        return userCenterInterface.commitBankInfo(map);
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<PickDeviceEntity2>>>> getPickDeviceList(int page, int size, String areacode, List<String> cityList) {
        Map map = new HashMap();
        map.put("pageNum", page);
        map.put("pageSize", size);
        map.put("areaCode", areacode);
        map.put("cityNo", cityList);
        return pickInterface.getPickDeviceList(map);
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<PickLabourEntity>>>> getPickLaborList(int page, int size, String areacode, List<String> cityList) {
        Map map = new HashMap();
        map.put("pageNum", page);
        map.put("pageSize", size);
        map.put("areaCode", areacode);
        map.put("cityNo", cityList);
        return pickInterface.getPickLaborList(map);
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<PickPackersEntity>>>> getPickPackersList(int page, int size, String areacode, List<String> cityList, List<String> typeList, String type) {
        Map map = new HashMap();
        map.put("pageNum", page);
        map.put("pageSize", size);
        map.put("areaCode", areacode);
        map.put("cityNo", cityList);
        map.put("typeNo", typeList);
        map.put("type", type);
        return pickInterface.getPickPackersList(map);
    }

    @Override
    public Observable<BaseEntity<List<PickSelectEntity>>> getPickPackersType() {
        return pickInterface.getPickPackersType();
    }

    @Override
    public Observable<BaseEntity<TenderDetailEntity3<TenderInfoBasicEntity3<TenderDictEntity3>>>> getPickBidDetail(String id) {
        Map map = new HashMap();
        map.put("id", id);
        String localLng = SharedPreferenceUtil.getInstance().getString(SharedPreferenceUtil.LONGITUDE_ID, "");
        String localLat = SharedPreferenceUtil.getInstance().getString(SharedPreferenceUtil.LATITUDE_ID, "");
        map.put("localLng", localLng);
        map.put("localLat", localLat);
        return pickInterface.getPickBidDetail(map);
    }

    @Override
    public Observable<BaseEntity<List<DictEntity3>>> getPickRequireType() {
        return pickInterface.getPickRequireType();
    }

    @Override
    public Observable<BaseEntity<List<DictEntity3>>> getPickEngineeringType() {
        return pickInterface.getPickEngineeringType();
    }

    @Override
    public Observable<BaseEntity<List<DictEntity3>>> getPickScale(String type) {
        return pickInterface.getPickScale(type);
    }

    @Override
    public Observable<BaseEntity<List<DictEntity3>>> getPickMaterialType() {
        return pickInterface.getPickMaterialType();
    }

    @Override
    public Observable<BaseEntity<ShopImEntity>> getShopImInfo(String shopId) {
        return commonInterface.getShopImInfo(shopId);
    }

    @Override
    public Observable<BaseEntity<List<SearchMailEntity>>> searchMailList(String condition) {
        return commonInterface.searchMailList(condition);
    }

    @Override
    public Observable<BaseEntity<List<ParentAreaEntity<List<ParentAreaEntity>>>>> getAreaSecondAndThird(String areacode) {
        return commonInterface.getAreaSecondAndThird(areacode);
    }

    @Override
    public Observable<BaseEntity<List<DictEntity3>>> getAreaSecond(String areaCode) {
        return commonInterface.getAreaSecond(areaCode);
    }

    @Override
    public Observable<BaseEntity<List<DictEntity3>>> getAreaSecond2(String areaCode) {
        return commonInterface.getAreaSecond2(areaCode);
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<BidInvitationListEntity>>>> getBidInvitationList(int page, int size) {
        return userCenterInterface.getBidInvitationList(page, size);
    }

    @Override
    public Observable<BaseEntity<BidDetailEntity>> getBidDetail(String id) {
        return userCenterInterface.getBidDetail(id);
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<GoodsListEntity3>>>> getGoodsList(int page, int size, String condition, String status, List<String> cid3, String companyId, String flag) {
        Map map = new HashMap();
        map.put("pageNum", page);
        map.put("pageSize", size);
        map.put("text", condition);
        map.put("status", status);
        if (!flag.equals(""))
            map.put("flag", flag);
        if (cid3 != null && cid3.size() > 0) {
            map.put("cid3", cid3);
        }
        map.put("companyId", companyId);
        return userCenterInterface.getGoodsList(map);
    }

    @Override
    public Observable<BaseEntity<List<DictEntity3>>> getGoodsAllDict() {
        return userCenterInterface.getGoodsAllDict();
    }

    @Override
    public Observable<BaseEntity> upDowngetGoods(String opt, List<String> goodsIds) {
        Map map = new HashMap();
        map.put("status", opt);
        map.put("goodsIds", goodsIds);
        return userCenterInterface.upDowngetGoods(map);
    }

    @Override
    public Observable<BaseEntity> modifyGoodsPrice(String price, String type, List<String> goodsIds) {
        Map map = new HashMap();
        map.put("price", price);
        map.put("type", type);
        map.put("goodsIds", goodsIds);
        return userCenterInterface.modifyGoodsPrice(map);
    }

    @Override
    public Observable<BaseEntity> modifyGoodsDetailPrice(String id, String price) {
        return userCenterInterface.modifyGoodsDetailPrice(id, price);
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<SelfPickListEntity3>>>> getCollectList(int page, int size, String status, String type, String groupBuyClass, String goodsName) {
        Map map = new HashMap();
        map.put("limit", size);
        map.put("page", page);
        map.put("status", status);
        map.put("groupbuyTypes", type);
        map.put("groupBuyClass", groupBuyClass);
        map.put("goodsName", goodsName);
        return userCenterInterface.getCollectList(map);
    }

    @Override
    public Observable<BaseEntity> deleteCollectList(String no) {
        return userCenterInterface.deleteCollectList(no);
    }

    @Override
    public Observable<BaseEntity> deleteCollectList2(String no) {
        return userCenterInterface.deleteCollectList2(no);
    }

    @Override
    public Observable<BaseEntity<List<DictEntity3>>> getMachineFilterType() {
        return leaseInterface.getMachineFilterType();
    }

    @Override
    public Observable<BaseEntity<List<DictEntity3>>> getMachineFilterModel(String parentNo) {
        return leaseInterface.getMachineFilterModel(parentNo);
    }

    @Override
    public Observable<BaseEntity<List<DictEntity3>>> getMachineFilterTime() {
        return leaseInterface.getMachineFilterTime();
    }

    @Override
    public Observable<BaseEntity<List<DictEntity3>>> getMachineFilterSort() {
        return leaseInterface.getMachineFilterSort();
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<MachineListEntity3>>>> getMachineList3(LeaseMachineFilterJson machineFilterJson3) {
        return leaseInterface.getMachineList3(machineFilterJson3);
    }

    @Override
    public Observable<BaseEntity<List<DictEntity3>>> getMachineFilterSpec(String id) {
        return leaseInterface.getMachineFilterSpec(id);
    }

    @Override
    public Observable<BaseEntity<List<DictEntity3>>> getDeviceFilterType() {
        return leaseInterface.getDeviceFilterType();
    }

    @Override
    public Observable<BaseEntity<List<DictEntity3>>> getDeviceFilterModel(String parentNo) {
        return leaseInterface.getDeviceFilterModel(parentNo);
    }

    @Override
    public Observable<BaseEntity<List<DictEntity3>>> getDeviceFilterSpec(String id) {
        return leaseInterface.getDeviceFilterSpec(id);
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<DeviceListEntity3>>>> getDeviceList3(MachineFilterJson3 machineFilterJson3) {
        return leaseInterface.getDeviceList3(machineFilterJson3);
    }

    @Override
    public Observable<BaseEntity<List<DictEntity3>>> getCarFilterType() {
        return leaseInterface.getCarFilterType();
    }

    @Override
    public Observable<BaseEntity<List<DictEntity3>>> getCarFilterBrand() {
        return leaseInterface.getCarFilterBrand();
    }

    @Override
    public Observable<BaseEntity<List<DictEntity3>>> getCarFilterMoney() {
        return leaseInterface.getCarFilterMoney();
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<CarListEntity3>>>> getCarList3(MachineFilterJson3 machineFilterJson3) {
        return leaseInterface.getCarList3(machineFilterJson3);
    }

    @Override
    public Observable<BaseEntity<List<DictEntity3>>> getMaterialFilterType(String id, String areacode) {
        return materialInterface.getMaterialFilterType(id, areacode);
    }

    @Override
    public Observable<BaseEntity<List<DictEntity3>>> getMaterialFilterName(String id, String areacode) {
        return materialInterface.getMaterialFilterName(id, areacode);
    }

    @Override
    public Observable<BaseEntity<List<DictEntity3>>> getMaterialFilterStore(String areacode) {
        return materialInterface.getMaterialFilterStore(areacode);
    }

    @Override
    public Observable<BaseEntity<List<DictEntity3>>> getMaterialFilterBrand(String id, String areacode) {
        return materialInterface.getMaterialFilterBrand(id, areacode);
    }

    @Override
    public Observable<BaseEntity<List<DictEntity3>>> getMaterialFilterSpec(String id, String areacode) {
        return materialInterface.getMaterialFilterSpec(id, areacode);
    }

    @Override
    public Observable<BaseEntity<List<DictEntity3>>> getMaterialDistanceData() {
        return materialInterface.getMaterialDistanceData();
    }

    @Override
    public Observable<BaseEntity<List<DictEntity3>>> getMaterialPriceData() {
        return materialInterface.getMaterialPriceData();
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<SearchMaterialEntity>>>> getMaterialList(MaterialFilterJson materialFilterJson) {
        return materialInterface.getMaterialList(materialFilterJson);
    }

    @Override
    public Observable<BaseEntity<List<MenuEntity<MenuEntity>>>> getsecondCategory(String id, String areaCode) {
        return materialInterface2.getsecondCategory(id, areaCode);
    }

//    @Override
////    public Observable<BaseEntity<ListResponse<List<SearchSTEntity>>>> getSTList(MaterialFilterJson materialFilterJson) {
////        return materialInterface.getSTList(materialFilterJson);
////    }

//    @Override
//    public Observable<BaseEntity<ListResponse<List<SearchSTEntity>>>> getHomeSTList(MaterialFilterJson materialFilterJson) {
//        return homeInterface.getHomeSTList(materialFilterJson);
//    }

    @Override
    public Observable<BaseEntity<STFilterEntity>> getSTFilter(String areaCode) {
        return materialInterface.getSTFilter(areaCode);
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<SearchMaterialEntity3>>>> getMaterialList3(MaterialFilterJson3 materialFilterJson) {
        return materialInterface.getMaterialList3(materialFilterJson);
    }





}
